package com.baidu.day07;

public class Demo01 {
    public static void main(String[] args) {
        Animal dog = new Dog();
        dog.eat();
        Dog dog1 = (Dog)dog;
        dog1.shout();
       Animal cat = new Cat();






       Cat cat1 = (Cat)cat; //强制类型转换
       cat1.eat();
       //强制类相互转换
       if (cat instanceof Dog){
           Cat cat2 = (Cat) dog;
       }else {
           System.out.println("不是猫");
       }

    }
}
